/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.ibiz.demo.mybdsys;

import org.springframework.stereotype.Component;
import net.ibizsys.paas.appmodel.AppModelGlobal;
import net.ibizsys.paas.core.ISystem;
import net.ibizsys.paas.sysmodel.SysModelGlobal;
import net.ibizsys.paas.service.IService;
import net.ibizsys.paas.service.ServiceGlobal;
import net.ibizsys.paas.appmodel.AppViewModel;
import net.ibizsys.paas.appmodel.AppDEViewModel;
import com.sa.ibiz.demo.srv.MyTestSysSysModel;

/**
 * 应用程序[MyBDSys]模型对象
 */
@Component
public class MyBDSysAppModel extends net.ibizsys.paas.appmodel.AppModelBase  {

    public MyBDSysAppModel() throws Exception {
        super();
        //设置应用基本信息
        this.setId("9DDB4682-BFAE-47E6-BCB8-115BBF713465");
        this.setName("MyBDSys");
        this.setPFType("JQUERY_SHARE");
        //注册到全局应用程序模型对象
        AppModelGlobal.registerApplication("com.sa.ibiz.demo.mybdsys.MyBDSysAppModel",this);
        //准备应用用户模式菜单
        this.prepareAppUserModeMenus();
        //准备应用视图
        this.prepareAppViews();
    }

    private MyTestSysSysModel myTestSysSysModel;

    /**
     * 获取当前系统模型对象
     * @return
     */
    public  MyTestSysSysModel getMyTestSysSysModel() {
        if(this.myTestSysSysModel==null) {
            try {
                this.myTestSysSysModel = (MyTestSysSysModel)SysModelGlobal.getSystem("com.sa.ibiz.demo.srv.MyTestSysSysModel");
            } catch(Exception ex) {
            }
        }
        return this.myTestSysSysModel;
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.core.IApplication#getSystem()
     */
    @Override
    public  ISystem getSystem() {
        return this.getMyTestSysSysModel();
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.appmodel.AppModelBase#setPFType(java.lang.String)
     */
    @Override
    protected void setPFType(String strPFType) {
        super.setPFType(strPFType);
    }

    /**
     * 准备应用用户模式菜单
     * @throws Exception
     */
    protected void prepareAppUserModeMenus()throws Exception {
    }

    /**
     * 准备应用视图
     * @throws Exception
     */
    protected void prepareAppViews()throws Exception {
    }


    /* (non-Javadoc)
     * @see net.ibizsys.paas.appmodel.AppModelBase#onInstallRTDatas()
     */
    @Override
    protected void onInstallRTDatas() throws Exception {
        super.onInstallRTDatas();

        //登记所有的门户界面
        net.ibizsys.psrt.srv.common.service.PortalPageService portalPageService  = (net.ibizsys.psrt.srv.common.service.PortalPageService)ServiceGlobal.getService(net.ibizsys.psrt.srv.common.service.PortalPageService.class);
        net.ibizsys.psrt.srv.common.service.PVPartService pvPartService  = (net.ibizsys.psrt.srv.common.service.PVPartService)ServiceGlobal.getService(net.ibizsys.psrt.srv.common.service.PVPartService.class);
    }
}